# name是类属性，实例和类都能直接访问
# class Student(object):
#     name = "Stucent"
# class Student1():
#     name = "Stucent1"
# s = Student()
# s1 = Student1()
# print(isinstance(s,(object)))
# print(isinstance(s1,(object)))

# print(s.name)
# print(s1.name)
# print(Student.name)
# print(Student1.name)

print("================practice=================================")

class Student(object):
    count = 0
    def __init__(self, name):
        self.name = name
        Student.count+=1 # 不能直接写count

# 测试:
if Student.count != 0:
    print('测试失败!')
else:
    bart = Student('Bart')
    if Student.count != 1:
        print('测试失败!')
    else:
        lisa = Student('Bart')
        if Student.count != 2:
            print('测试失败!')
        else:
            print('Students:', Student.count)
            print('测试通过!')
